package com.cloud.mall.cms.service;

import com.cloud.mall.api.CommonPage;
import com.cloud.mall.base.BaseResponse;
import com.cloud.mall.cms.out.CmsSubjectOut;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@Api(tags = "商品专题管理")
@RequestMapping("/subject")
public interface CmsSubjectService {

    @ApiOperation("获取全部商品专题")
    @GetMapping("/listAll")
    BaseResponse<List<CmsSubjectOut>> list();

    @ApiOperation(value = "根据专题名称分页获取专题")
    @GetMapping("/list")
    BaseResponse<CommonPage<CmsSubjectOut>> getList(@RequestParam(value = "keyword", required = false) String keyword,
                                                    @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                    @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize);

    @ApiOperation(value = "分页获取专题")
    @GetMapping("/getRecommendSubjectList")
    BaseResponse<List<CmsSubjectOut>> getRecommendSubjectList( @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum,
                                                    @RequestParam(value = "pageSize", defaultValue = "5") Integer pageSize);

    @ApiOperation("根据分类获取专题")
    @GetMapping("/subjectList")
    BaseResponse <CommonPage<CmsSubjectOut>> getSubjectList(@RequestParam(required = false) Long cateId,
                                                   @RequestParam(value = "pageSize", defaultValue = "4") Integer pageSize,
                                                   @RequestParam(value = "pageNum", defaultValue = "1") Integer pageNum);
}
